﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Utility
{
    public class StaticConstraint
    {
        /// <summary>
        /// 以前直接读配置文件
        /// ConnectionStrings:JDDbConnectionString
        /// </summary>
        public static string JDDbConnection = null;
        /// <summary>
        /// 消息队列key
        /// </summary>
        public static string noticeCacheKey = "notice";
        /// <summary>
        /// 系统超管账号
        /// </summary>
        public static int TruronSuperAdminId = 1;

        #region center constraint

        /// <summary>
        /// 系统默认密码
        /// </summary>
        public static string TruronPassword = "truron123";

        /// <summary>
        /// 用户信息缓存key
        /// </summary>
        public static string userCacheKey = "sysuser";

        /// <summary>
        /// 部门缓存key
        /// </summary>
        public static string deptCacheKey = "sysdept";

        /// <summary>
        /// 角色缓存key
        /// </summary>
        public static string roleCacheKey = "sysrole";
        /// <summary>
        /// 模块缓存key
        /// </summary>
        public static string moduleCacheKey = "sysmodule";

        /// <summary>
        /// 用户角色缓存key
        /// </summary>
        public static string userRoleCacheKey = "sysuserrole";

        /// <summary>
        /// 角色模块缓存key
        /// </summary>
        public static string roleModuleCacheKey = "sysrolemodule";

        /// <summary>
        /// 数据源缓存key
        /// </summary>
        public static string dataSourceCacheKey = "sysdatasource";

        /// <summary>
        /// 测试标准缓存key
        /// </summary>
        public static string testStandardCacheKey = "systeststandard";
        /// <summary>
        /// 测试标准缓存key
        /// </summary>
        public static string testStandardGrpCacheKey = "systeststandardgrp";
        /// <summary>
        /// 测试标准缓存key
        /// </summary>
        public static string testStandardItemCacheKey = "systeststandarditem";

        public static string areaCacheKey = "sysarea";
        public static string SysAuthStandardWorkHourKey = "SysAuthStandardWorkHour";
        /// <summary>
        /// 汇率
        /// </summary>
        public static string sysExchange = "sysexchange";
        /// <summary>
        /// 用户自定义模块Key
        /// </summary>
        public static string SysUserCustomModuleKey = "SysUserCustomModule";
        /// <summary>
        /// 办公地点
        /// </summary>
        public static readonly string Sys_PositionCacheKey = "Sys_Position";
        /// <summary>
        /// 公司
        /// </summary>
        public static readonly string Sys_Company = "SysCompany";
        /// <summary>
        /// 大部门
        /// </summary>
        public static readonly string Sys_GeneralDeptCacheKey = "Sys_GeneralDept";
        /// <summary>
        /// 公司
        /// </summary>
        public static readonly string Sys_CompanyCacheKey = "Sys_Company";
        /// <summary>
        /// 部门
        /// </summary>
        public static readonly string Sys_DeptCacheKey = "Sys_Dept";
        /// <summary>
        /// 公司账户
        /// </summary>
        public static readonly string Sys_CompanyAccountCacheKey = "Sys_CompanyAccount";
        #endregion

        #region crm constraint
        /// <summary>
        /// 联系人信息缓存key
        /// </summary>
        public static string contactsCacheKey = "crmcontacts";
        /// <summary>
        /// 联系人共享信息缓存key
        /// </summary>
        public static string contactsShareCacheKey = "crmcontactsshare";
        /// <summary>
        /// 客户信息缓存key
        /// </summary>
        public static string customerCacheKey = "crmcustomer";
        /// <summary>
        /// 客户共享信息缓存key
        /// </summary>
        public static string customerShareCacheKey = "crmcustomershare";
        /// <summary>
        /// 客户、联系人关联信息缓存key
        /// </summary>
        public static string cc_relarionCacheKey = "crm_cc_relation";
        /// <summary>
        /// 线索信息缓存key
        /// </summary>
        public static string crmclueCacheKey = "crmclue";
        /// <summary>
        /// 商机缓存key
        /// </summary>
        public static string crmbusinesCacheKey = "crmbusines";
        /// <summary>
        /// 报价单缓存key
        /// </summary>
        public static string crmquotationCacheKey = "crmquotation";
        /// <summary>
        /// 订单缓存key
        /// </summary>
        public static string crmorderCacheKey = "crmorder";

        /// <summary>
        /// crm数据源缓存key
        /// </summary>
        public static string crmdatasourceCacheKey = "crmdatasource";
        /// <summary>
        /// crm产品缓存key
        /// </summary>
        public static string crmproductCacheKey = "crmproduct";

        /// <summary>
        /// crm分组缓存key
        /// </summary>
        public static string crmGrpCacheKey = "crmgrp";
        /// <summary>
        /// Crm测试标准缓存Key
        /// </summary>
        public static string crmTestStandardKey = "CrmTestStandard";
        /// <summary>
        /// Crm测试标准缓存Key
        /// </summary>
        public static string crmTestStandardItemKey = "CrmTestStandardItem";
        /// <summary>
        /// Crm测试标准缓存Key
        /// </summary>
        public static string crmTestCaseKey = "CrmTestCase";

        /// <summary>
        /// Crm合同
        /// </summary>
        public static string crmContractKey = "CrmContract";
        #endregion

        #region purchase constraint
        /// <summary>
        /// 委外单key
        /// </summary>
        public static string PurchaseOuterNoteCacheKey = "Purchase_OuterNote";
        /// <summary>
        /// 区域key
        /// </summary>
        public static string PurchaseAreaCacheKey = "Purchase_Area";
        /// <summary>
        /// 分类key
        /// </summary>
        public static string PurchaseCategoryCacheKey = "Purchase_Category";
        /// <summary>
        /// 供应商key
        /// </summary>
        public static string PurchaseSupplyCacheKey = "Purchase_Supply";
        /// <summary>
        /// 委外需求key
        /// </summary>
        public static string PurchaseOuterRequestCacheKey = "Purchase_OuterRequest";
        /// <summary>
        /// 委外明细key
        /// </summary>
        public static string PurchaseOuterRequestDetailCacheKey = "Purchase_OuterRequestDetail";
        /// <summary>
        /// 委外需求审批key
        /// </summary>
        public static string PurchaseOuterRequestApproveCacheKey = "Purchase_OuterRequestApprove";
        /// <summary>
        /// 委外和需求单的关系
        /// </summary>
        public static string PurchaseOuterRequestNoteRelationCacheKey = "Purchase_OuterRequestNoteRelation";
        /// <summary>
        /// 委外单审批key
        /// </summary>
        public static string PurchaseOuterNoteApprovalCacheKey = "Purchase_OuterNoteApproval";
        /// <summary>
        /// 文件key
        /// </summary>
        public static string PurchaseFileInfoCacheKey = "Purchase_FileInfo";
        /// <summary>
        /// 左侧树分组的key
        /// </summary>
        public static string PurchaseLeftGroupKey = "PurchaseLeftGroup";
        public static string Purchase_TestCacheKey = "Purchase_Test";
        public static string Purchase_OuterRequestDetailApprovalCacheKey = "Purchase_OuterRequestDetailApproval";
        public static string Purchase_OuterNoteDetailCacheKey = "Purchase_OuterNoteDetail";
        public static string Purchase_DataSourceCacheKey = "Purchase_DataSource";
        public static string Purchase_OuterNotePayRelationCacheKey = "Purchase_OuterNotePayRelation";
        public static string Purchase_OuterNoteInvoiceRelationCacheKey = "Purchase_OuterNoteInvoiceRelation";
        public static string Purchase_OperateLogCacheKey = "Purchase_OperateLog";
        public static string Purchase_RequestCacheKey = "Purchase_Request";
        public static string Purchase_RequestApprovalCacheKey = "Purchase_RequestApproval";
        public static string Purchase_ItemCacheKey = "Purchase_Item";
        public static string Purchase_RequestOperateRecordCacheKey = "Purchase_RequestOperateRecord";
        public static string Purchase_RequestItemApprovalCacheKey = "Purchase_RequestItemApproval";
        public static string Purchase_SourcingCacheKey = "Purchase_Sourcing";
        public static string Purchase_ContractCacheKey = "Purchase_Contract";
        public static string Purchase_POOperateRecordCacheKey = "Purchase_POOperateRecord";
        public static string Purchase_ItemCostCacheKey = "Purchase_ItemCost";
        public static string Purchase_ItemPayRelationCacheKey = "Purchase_ItemPayRelation";
        public static string Purchase_ItemInvoiceRelationCacheKey = "Purchase_ItemInvoiceRelation";
        public static string Purchase_AssestsCacheKey = "Purchase_Assests";
        public static string Purchase_OuterRequestDetailOperateRecordCacheKey = "Purchase_OuterRequestDetailOperateRecord";
        public static string Purchase_OuterRequestProgressCacheKey = "Purchase_OuterRequestProgress";
        public static string Purchase_SupplyEvaluationsCacheKey = "Purchase_SupplyEvaluations";
        public static string Purchase_SupplyApprovalCacheKey = "Purchase_SupplyApproval";
        public static string Purchase_RequestItemCacheKey = "Purchase_RequestItem";
        public static string Purchase_SourcingDetailCacheKey = "Purchase_SourcingDetail";
        public static string Purchase_ItemDetailCacheKey = "Purchase_ItemDetail";
        public static string Purchase_SupplyServiceCacheKey = "Purchase_SupplyService";
        public static string Purchase_OuterNoteContractRelationCacheKey = "Purchase_OuterNoteContractRelation";
        public static string Purchase_ItemCostDetailCacheKey = "Purchase_ItemCostDetail";
        public static string Purchase_ExpenseCacheKey = "Purchase_Expense";
        public static string Purchase_ExpenseItemCacheKey = "Purchase_ExpenseItem";
        public static string Purchase_ExpenseCostCacheKey = "Purchase_ExpenseCost";
        public static string Purchase_ExpenseCostDetailCacheKey = "Purchase_ExpenseCostDetail";
        public static string Purchase_ExpenseInvoiceRelationCacheKey = "Purchase_ExpenseInvoiceRelation";
        public static string Purchase_ExpensePayRelationCacheKey = "Purchase_ExpensePayRelation";
        public static string Purchase_ExpenseApprovalCacheKey = "Purchase_ExpenseApproval";
        public static string Purchase_OuterRequestDeliverCacheKey = "Purchase_OuterRequestDeliver";
        public static string Purchase_OuterRequestEvidenceCacheKey = "Purchase_OuterRequestEvidence";
        public static string Purchase_ItemApprovalCacheKey = "Purchase_ItemApproval";
        public static string Purchase_MaterialCacheKey = "Purchase_Material";
        public static string Purchase_MaterialInCacheKey = "Purchase_MaterialIn";
        public static string Purchase_MaterialOutCacheKey = "Purchase_MaterialOut";
        public static string Purchase_MaterialStockCacheKey = "Purchase_MaterialStock";
        public static string Purchase_MaterialOutDetailCacheKey = "Purchase_MaterialOutDetail";
        public static string Purchase_MaterialOutMatCacheKey = "Purchase_MaterialOutMat";
        public static string Purchase_CheckTaskCacheKey = "Purchase_CheckTask";
        public static string Purchase_AssestsPartCacheKey = "Purchase_AssestsPart";
        public static string Purchase_AssestsCheckCacheKey = "Purchase_AssestsCheck";
        public static string Purchase_AssestsCheckDetailCacheKey = "Purchase_AssestsCheckDetail";
        public static string Purchase_AssestsAcceptCacheKey = "Purchase_AssestsAccept";
        public static string Purchase_CheckNoteCacheKey = "Purchase_CheckNote";
        public static string Purchase_IntelAssestsPartCacheKey = "Purchase_IntelAssestsPart";
        public static string Purchase_OtherDataCacheKey = "Purchase_OtherData";
        public static string Purchase_MaterialApprovalCacheKey = "Purchase_MaterialApproval";
        public static string Purchase_CartCacheKey = "Purchase_Cart";
        public static string Purchase_MaterialParamCacheKey = "Purchase_MaterialParam";
        public static string Purchase_AssestsFiCacheKey = "Purchase_AssestsFi";
        public static string Purchase_MaterialParamTemplateCacheKey = "Purchase_MaterialParamTemplate";
        public static string Purchase_CheckSolutionCacheKey = "Purchase_CheckSolution";
        public static string Purchase_AssestsHistoryCacheKey = "Purchase_AssestsHistory";
        public static string Purchase_AssestsOperateLogCacheKey = "Purchase_AssestsOperateLog";
        public static string Purchase_AssestsPanDianCacheKey = "Purchase_AssestsPanDian";
        public static string Purchase_AssestsPanDianDetailCacheKey = "Purchase_AssestsPanDianDetail";
        public static string Purchase_MaterialParamTemplateUnitCacheKey = "Purchase_MaterialParamTemplateUnit";
        public static string Purchase_MaterialCheckCacheKey = "Purchase_MaterialCheck";
        public static string Purchase_ManufacturerCacheKey = "Purchase_Manufacturer";
        public static string Purchase_AssestChangeCacheKey = "Purchase_AssestChange";
        public static string Purchase_AssestCheckProjectCacheKey = "Purchase_AssestCheckProject";
        public static string Purchase_AssestsAcceptApprovalCacheKey = "Purchase_AssestsAcceptApproval";
        public static string Purchase_AssestsCheckRequestCacheKey = "Purchase_AssestsCheckRequest";
        public static string Purchase_CommonOperateLogCacheKey = "Purchase_CommonOperateLog";
        public static string Purchase_AssestCheckRequestDetailCacheKey = "Purchase_AssestCheckRequestDetail";
        public static string Purchase_AssestsCheckRequestApprovalCacheKey = "Purchase_AssestsCheckRequestApproval";
        public static string Purchase_AssestCheckPlanCacheKey = "Purchase_AssestCheckPlan";
        public static string Purchase_AssestRepairCacheKey = "Purchase_AssestRepair";
        public static string Purchase_AssestsCheckDetailApprovalCacheKey = "Purchase_AssestsCheckDetailApproval";
        public static string Purchase_AssestRepairApprovalCacheKey = "Purchase_AssestRepairApproval";
        public static string Purchase_AssestChangeApprovalCacheKey = "Purchase_AssestChangeApproval";
        public static string Purchase_AssestCheckRequestDelayCacheKey = "Purchase_AssestCheckRequestDelay";
        public static string Purchase_AssestsDepreCacheKey = "Purchase_AssestsDepre";
        #endregion

        #region finance constraint
        /// <summary>
        /// 数据源缓存Key
        /// </summary>
        public static readonly string sourceCacheKey = "finance_datasource";
        /// <summary>
        /// 收款缓存Key
        /// </summary>
        public static readonly string incomeCacheKey = "finance_income";
        /// <summary>
        /// 收款订单关联缓存Key
        /// </summary>
        public static readonly string incomeOrderCacheKey = "finance_incomeorder";
        /// <summary>
        /// 开票任务缓存Key
        /// </summary>
        public static readonly string invoiceTaskCacheKey = "finance_invoicetask";
        /// <summary>
        /// 开票缓存Key
        /// </summary>
        public static readonly string invoiceCacheKey = "finance_invoice";

        public static readonly string Finance_PaymentCacheKey = "Finance_Payment";
        public static readonly string FinanceLeftGroupKey = "FinanceLeftGroup";
        public static readonly string Finance_PaymentApprovalCacheKey = "Finance_PaymentApproval";
        public static readonly string Finance_InvoiceCacheKey = "Finance_PayInvoice";
        public static readonly string Finance_PayInvoiceApprovalCacheKey = "Finance_PayInvoiceApproval";
        public static readonly string Finance_SubjectCacheKey = "Finance_Subject";
        public static readonly string Finance_SubjectTypeCacheKey = "Finance_SubjectType";
        public static readonly string Finance_PayInvoiceSplitCacheKey = "Finance_PayInvoiceSplit";
        public static readonly string Finance_SencondSubjectCacheKey = "Finance_SencondSubject";
        public static readonly string Finance_PayInvoiceSplitProjectCacheKey = "Finance_PayInvoiceSplitProject";
        public static readonly string Finance_PayInvoiceSplitPorjectDetailCacheKey = "Finance_PayInvoiceSplitPorjectDetail";
        public static readonly string Finance_PayInvoiceItemCacheKey = "Finance_PayInvoiceItem";

        #endregion

        #region common constraint
        public static readonly string Sys_FileInfoCacheKey = "Sys_FileInfo";
        public static readonly string Sys_CodeGenrateKey = "Sys_CodeGenrate";
        public static readonly string SysMailKey = "SysMail";

        public static readonly string ecappid = "0367fb3f-1859-4f67-9d6c-96e18c7385cc";
        public static readonly string RSAPublicKey = "<RSAKeyValue><Modulus>1c/Zx+9/CZATNJXoSpWw67s+1SSjhtnahXeVLnWIo/l6v7WC51Ndw7YxhaiNrgsO+bOXdPEQcwMxIZtIkPzCA/lE3IZE1CKARIPrItjzmvPPuxah9CF0Cj8E5AM/4I2fQHun5ryWsfV4l9DtYY6Q9eOY0dR48p8SqQyXd1/mD3E=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
        public static readonly string RSAPrivateKey = "<RSAKeyValue><Modulus>1c/Zx+9/CZATNJXoSpWw67s+1SSjhtnahXeVLnWIo/l6v7WC51Ndw7YxhaiNrgsO+bOXdPEQcwMxIZtIkPzCA/lE3IZE1CKARIPrItjzmvPPuxah9CF0Cj8E5AM/4I2fQHun5ryWsfV4l9DtYY6Q9eOY0dR48p8SqQyXd1/mD3E=</Modulus><Exponent>AQAB</Exponent><P>3H+sX6SAkuLDZvrEaH7DJmGku3oerLXbZhFVMXi8huNJ0xBi/ftJIwZY+F51/jD8iwlUnJLEYgkrdeP9iUCQHw==</P><Q>+DyQ+bEkNxOPP8FmCiuxQO2lnKqF2QunHQfHV5/wjYft+WU2xnjAorBjYHfE9+UE2l+5Bc9oh/ei09+SNL4ubw==</Q><DP>jK+tdMzJ+G5VDKSdoqqWqyuL5s6ROdNCrEoM2GbXqxzkIpYHA1RMottO8xGaKVhqGfAXG1uNj5uYLj0MrIEUMw==</DP><DQ>Q8I8jHum+AW1x2BiGwqcIq3708zUJk/A+PKjni6BOhDNi5LuJbTWWFIvfiiTMltoPLd+SLC5xst4vb68KPt0rw==</DQ><InverseQ>l3ulgwlHwFvGnKrSWVejpyIZy6ALb2R5d2rBz4/JtjqTz//oWJ5blKn848ZSEQG7hvRisUqC5CA/TkAyCGnheA==</InverseQ><D>Iy3auFHIhitFba6IlNUCUhbx5KHtof9wO+uMCSPfgpNGxgo4apVF5TCx/zrXbN527VDGR8BuI25QBCaHjwt3ZGDcdcwv4otfzwLEeqxhts0BSQuelJ2ah0i9J4oKryZvEEq7LPzavu90pwagUIJgIKAufcp8ArWjJWpO8VqrM50=</D></RSAKeyValue>";
        //此处的spk为ec直接生成的java格式
        public static readonly string ECSPK = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvYfeHhyLFEJ0Wv0DVbR9yic1iLEDLReSNan3Y5Za20ehLThFi9hDzjJVMfNSiopMpMAbeUez5S4Joz9OduQVSk6N29U1plnn24CjRLych5WN/zcN3dWWX5cjUdwVoReYO09WEY+v56fgA9TXl0pDxDO2bxhRPR+OZNjRvBSLxc0aFbTaw3yGQJrLtO6yEm0FKpZE8u0TBCftSa22UTmKAjp7xJ66YXeTUP8/JXpFNpZtKcvyNYjZrPyZcfm5FHFCD8sNH5yhQmcCyHdBu1d6wdrUrHdf+e4NdWmmaMv6qKvW0QK/MOAupG+DPMCybFCct3yY+PgQwdAmBfCUt2abnwIDAQAB";
        //此处是转换为C#可用的格式
        public static readonly string CSharpSPK = "<RSAKeyValue><Modulus>vYfeHhyLFEJ0Wv0DVbR9yic1iLEDLReSNan3Y5Za20ehLThFi9hDzjJVMfNSiopMpMAbeUez5S4Joz9OduQVSk6N29U1plnn24CjRLych5WN/zcN3dWWX5cjUdwVoReYO09WEY+v56fgA9TXl0pDxDO2bxhRPR+OZNjRvBSLxc0aFbTaw3yGQJrLtO6yEm0FKpZE8u0TBCftSa22UTmKAjp7xJ66YXeTUP8/JXpFNpZtKcvyNYjZrPyZcfm5FHFCD8sNH5yhQmcCyHdBu1d6wdrUrHdf+e4NdWmmaMv6qKvW0QK/MOAupG+DPMCybFCct3yY+PgQwdAmBfCUt2abnw==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
        //访问ec的密钥
        public static readonly string Secret = "370f8cce-cf60-444a-89e7-6e36beeef5a2";
        //使用spk公钥加密后的密钥
        public static readonly string RSASecret = "igmwvlA1ikJ2Q5HdcUHSzVloAvZ1ZRWkbfISEYqY0cqJ+wZ+Vix04wQPFW+fuvcuzGvt2tKLRK4/9pgL3e4qQL4UT3yZqzxE1v2+sqtoWf7G8CnFDb+RSheSmRM6BUavNUHP+ko0S8612+4LS+c1Mnt7yUDuCSDrxaFqOrKXf9tdXE8oCs5hRq/JFhrvYBIdXqyu9HgjLhc4XgDFnsbHEOTnKQCag6AUMj7mkjZbCnM9LDjZh/S1DGAGeSN0twh6FZ+UFo2/Iz3wzvkAEllEqTam4R3JcAwnUEH0Jmw56eRvt8L4yrZw1dPZUHBzusFcKdRqcknLsBSCFPB3zp2oNA==";
        #endregion

        #region Porperty
        public static readonly string PorpertyValueKey = "PorpertyValue";
        public static readonly string PorpertyTypeECKey = "PorpertyTypeEC";
        #endregion

        #region
 

        public static string RedisDbStr = "127.0.0.1:6379";
        public static string CurrentEnv = "new";
        #endregion

        public static void Init(Func<string, string> func)
        {
            JDDbConnection = func.Invoke("AppSettings:ConnectionString");
            //循环--反射的方式初始化多个
        }

    }
    public static class ErrorCodeConst
    {
        /// <summary>
        /// 自定义错误
        /// </summary>
        public static int CustomError = 899;
        /// <summary>
        /// token验证失败
        /// </summary>
        public static int TokenError = 900;
        /// <summary>
        /// 服务调用失败
        /// </summary>
        public static int ServiceError = 990;
        /// <summary>
        /// 参数解析失败
        /// </summary>
        public static int ParameterError = 998;
        /// <summary>
        /// 用户名或密码错误
        /// </summary>
        public static int UserOrPassWordError = 1000;
        /// <summary>
        /// 用户信息不存在
        /// </summary>
        public static int UserIsNotExist = 1001;
        /// <summary>
        /// 原始密码验证失败
        /// </summary>
        public static int PassWordVerifyError = 1002;
        /// <summary>
        /// 账号已被禁用,请联系管理员
        /// </summary>
        public static int UserActIsDisable = 1003;

        /// <summary>
        /// 系统角色无法删除,请联系管理员
        /// </summary>
        public static int DelSysRoleError = 1004;
        /// <summary>
        /// 用户邮箱信息维护不完整
        /// </summary>
        public static int UserMailLost = 1005;


        /// <summary>
        /// 系统服务调用错误
        /// </summary>
        public static int SysServiceError = 1999;

    }
}
